<template>
  <div class="edit-store">
    <div class="bg-fff">
      <div class="input-div">
        <span class="left">客服电话</span>
        <input type="text" placeholder="请输入电话" v-model="info.phone">
      </div>
      <div class="input-div">
        <!-- <span class="left">接待日期</span> -->
        <popup-picker class="left" title="接待日期" :data="list1"  value-text-align="right" v-model="days"  placeholder="选择接待日期"></popup-picker>
      </div>
      <div class="input-div">
        <span class="left">接待时间</span>
      </div>
    </div>
    <span class="btn" @click="saveInfo()">保存</span>
  </div>
</template>

<script>

  import {home,editstore} from '@/api/api'
  import { PopupPicker} from 'vux'
  export default {
    components: {
      PopupPicker,
    },
    data () {
      return {
        info:[],
        days:'',
        list1:[['aaa','bbb','ccc']]
      }
    },
    created () {
      this.getHome()
    },
    methods: {
      router (path) {
        this.$router.push(path)
      },
      getHome() {
        home().then((res) =>{
          console.log(res.data.info)
          this.info=res.data.info
        }).catch((err) => {
          console.dir(err)
        })
      },
      saveInfo(){
        editstore(this.info.phone,'8:00-18:00','周一到周五').then((res) =>{
          console.log(res)
          if(res.data.status==1){
            this.router({'path':'./storeDetails'})
          }
        }).catch((err) => {
          console.dir(err)
        })
      }
    }
  }
</script>

<style lang="stylus" scoped>
.edit-store
  min-height 100vh
  background-color #f5f5f5
  .bg-fff
    background-color #fff
    padding 0 1.5rem
    .input-div
      border-bottom 1px solid #e6e6e6
      position relative
      overflow hidden
      line-height 5rem
      height 5rem
      &:last-child
        border none
      .left
        float left
        font-size 1.5rem
        color #333
      input
        position absolute
        right 0px
        text-align right
        color #333
        font-size 1.5rem
        top 0
        width calc(100vw - 15rem)
        height 5rem
        line-height 5rem
        &::-webkit-input-placeholder
          color #ccc
  .btn
    width 92%
    margin-left 4%
    border-radius 100px
    background-color #172F6D
    text-align center
    color #fff
    height 5rem
    line-height 5rem
    font-size 1.7rem
    display block
    margin-top 1rem
</style>
